<?php

namespace App\Models\users;

use App\Models\BaseModel;

class UsersAmountRecordModel extends BaseModel
{
    const getTypeName = [
        'users_withdraw_order' => '提现订单',
        'order' => '产品订单',
        'order_refund' => '产品退款',
    ];

    const getCreditTypeName = [
        'credit' => '待入账收益',
        'amount' => '余额',
    ];

    protected $table = 'users_amount_record';
    protected $primaryKey = 'id';

    const TYPE_INCOME = 1; // 收入
    const TYPE_EXPEND = 2; // 支出

    public function userInfo(): \Illuminate\Database\Eloquent\Relations\BelongsTo
    {
        return $this->belongsTo(UsersModel::class, 'uid', 'id');
    }
}
